<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@page import="com.bci.pwtz.common.util.PwtzUtils"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<%@ include file="/user/common.jsp"%>
<%@ page import="com.bci.pwtz.common.util.SpringUtil" %>
<%@ page import="com.bci.pwtz.mysql.model.Zydx" %>
<%@ page import="com.bci.pwtz.service.ZydxService" %>
<%@ page import="com.bci.pwtz.service.ZyxlService" %>
<%@ page import="com.bci.pwtz.mysql.model.Zyxl" %>
<%@ page import="com.bci.pwtz.service.BdzService" %>
<%@ page import="com.bci.pwtz.mysql.model.Bdz" %>
<%
Long companyId=null;
if(user!=null){
    companyId=user.getLastCompanyId();
}
String deviceid=request.getParameter("deviceid");
//deviceid="9ea5996c-43b5-45e4-898f-ddd4d8d4f7a1";
ZydxService service=(ZydxService)SpringUtil.getBean("zydxService");
Zydx device=service.load(deviceid);
ZyxlService lineService=(ZyxlService)SpringUtil.getBean("zyxlService");
Zyxl line=lineService.load(device.getLinecode());
String linecode="";
String linename="";
String substationcode="";
String transformername="";
if(line!=null){
    linecode=line.getDeviceid();
    linename=line.getDevicename();
    substationcode=line.getStartsubstationcode();
    BdzService bdzService=(BdzService)SpringUtil.getBean("bdzService");
    transformername=bdzService.load(substationcode).getDevicename();
}
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>配网数据-中压导线</title>
<link href="<%=basePath %>user/css/style.css" rel="stylesheet" type="text/css" />
<link href="<%=basePath %>user/css/llcss.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="<%=basePath %>js/jquery/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="<%=basePath %>js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/hd_ll.js"></script>
<script type="text/javascript" src="<%=basePath %>user/js/common.js"></script>
<script type="text/javascript" src="<%=basePath %>js/ajaxfileupload.js"></script>
<script type="text/javascript" src="<%=basePath %>js/toolutils.js"></script>
<script type="text/javascript">
var companyId=<%=companyId%>;
var deviceid='<%=linecode%>';
var transformercode='<%=line.getStartsubstationcode()%>';
var transformername='<%=transformername%>';
var model = '<%=device.getModel()%>';
var productionfactory = '<%=device.getProductionfactory()%>';
var wirespecification = '<%=device.getWirespecification()%>';
</script>
<script type="text/javascript" src="<%=basePath %>user/z/js/zydxadd.js"></script>
<script type="text/javascript">
function selectLoad(){
	setDefault('operationstate','<%=device.getOperationstate()%>');
	setDefault('equipmentstate','<%=device.getEquipmentstate()%>');
	setDefault('isruralpowernetwork','<%=device.getIsruralpowernetwork()%>');
	setDefault('isgenerationdimension','<%=device.getIsgenerationdimension()%>');
	setTimeout(function(){
		setDefault('model','<%=device.getModel()%>');
		setDefault('productionfactory','<%=device.getProductionfactory()%>');
	},100);
	setDefault('starttowercode','<%=device.getStarttowercode()%>');
	setDefault('endtowercode','<%=device.getEndtowercode()%>');
	setDefault('wirespecification','<%=device.getWirespecification()%>');
	setDefault('wirearrange','<%=device.getWirearrange()%>');
	setDefault('assetsnature','<%=device.getAssetsnature()%>');
	dgtStart(companyId,"<%=device.getStarttowercode()%>","<%=device.getEndtowercode()%>");
}
</script>
</head>
<body bgcolor="white" onload="selectLoad()">
	<%@ include file="/user/head.jsp"%>
	<!-- main_begin -->
	<div class="pwsj_cont_box">
	<%@ include file="/user/left.jsp"%>
	<!-- 右侧内容_begin -->
	<%if(device!=null) {%>
	<form id="form">
		<div class="pwsj_cont_right_box" scroll="no">
		<!-- 柱上变压器_begin -->
		<div class="pwsj_right_byq" scroll="no">
			<div class="pwsj_right_byq_position" style="margin-bottom:3px;">
				<a href="<%=basePath %>user/m/index.jsp" class="position">配网数据</a>&gt;
				<a href="<%=basePath %>user/z/bdzlist.jsp" class="position">变电站</a>&gt;
				<a href="<%=basePath %>user/z/zyxllist.jsp?deviceid=<%=substationcode %>" class="position">中压线路</a>&gt;
				<a  class="position">修改中压导线</a>
				<a class="right" href="<%=basePath%>user/z/zydxlist.jsp?deviceid=<%=linecode%>&t=<%=System.currentTimeMillis() %>">返回</a><a class="right"  onclick="edite()">保存</a>
			</div>
			<!-- 运行参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">运行参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>设备名称：</span><input class="text" type="hidden" id="deviceid" name="deviceid" value="<%=device.getDeviceid()%>"/><input class="text" type="text" id="devicename" name="devicename" maxlength="100" value="<%=device.getDevicename()%>"/><em style="color:red;"> *</em></li>
						<li class="argument_cont_li"><span>运行编号：</span><input class="text" type="text" id="devicenumber" name="devicenumber" value="<%=device.getDevicenumber()%>"/></li>
						<li class="argument_cont_li">
							<span>所属线路名称：</span><input class="text" type="text" readonly="readonly" value="<%=line.getDevicename()%>"/><input class="text" type="hidden" name="linecode" value="<%=line.getDeviceid()%>"/>
							<!-- <em style="color:red;"> *</em> -->
						</li>						
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>起始设备：</span>
							<select class="select_down" name="starttowercode" onchange="fillname()" id="starttowercode">
								<option value="0">--请选择--</option>
							</select>
						</li>	
						<li class="argument_cont_li">
							<span>终止杆塔：</span>
							<select class="select_down" name="endtowercode" onchange="fillname()" id="endtowercode">
								<option value="0">--请选择--</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li"><span>所属地市：</span><input class="text" type="text" id="localcity" name="localcity" value="<%=device.getLocalcity()%>"/><!-- <em style="color:red;"> *</em> --></li>					
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>运维单位：</span><input class="text" type="text" id="operationunit" name="operationunit" value="<%=device.getOperationunit()%>"/></li>
						<li class="argument_cont_li"><span>维护班组：</span><input class="text" type="text" id="maintenanceteam" name="maintenanceteam" value="<%=device.getMaintenanceteam()%>"/></li></li>							
						<li class="argument_cont_li" style="position:relative;"><span>投运日期：</span><input class="text" type="text"  placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="commissioningdate" value="<%=PwtzUtils.date2String(device.getCommissioningdate())%>"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /><!-- <em style="color:red;"> *</em> --></li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li" style="position:relative;">
							<span>是否代维：</span>
							<select class="select_down" id="isgenerationdimension" name="isgenerationdimension">
								<option value="是">是</option>
								<option value="否" selected="selected">否</option>
							</select>
						</li>	
						<li class="argument_cont_li" style="position:relative;">
							<span>是否农网：</span>
							<select class="select_down" id="isruralpowernetwork" name="isruralpowernetwork">
								<option value="是">是</option>
								<option value="否" selected="selected">否</option>
							</select>
						</li>
						<li class="argument_cont_li">
							<span>运行状态：</span>
							<select class="select_down" name="operationstate" id="operationstate">  
								<option value ="正常" selected="selected">正常</option>  
								<option value ="异常">异常</option>
								<option value ="故障">故障</option>
								<option value ="缺陷">缺陷</option> 			
							</select>
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>设备状态：</span>
							<select class="select_down" name="equipmentstate" id="equipmentstate">  
								<option value ="在运" selected="selected">在运</option>  
								<option value ="未投运">未投运</option>
								<option value ="退役">退役</option>
								<option value ="现场留用">现场留用</option>
								<option value ="库存备用">库存备用</option>
								<option value ="待报废">待报废</option>
								<option value ="报废">报废</option>
								<option value ="正常">正常</option>
								<option value ="异常">异常</option> 			
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>	
						<div class="clear"></div>
					</ul>
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 运行参数_end -->

			<!-- 物理参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">物理参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>型号：</span>
							<select class="select_down" id="model" name="model">  
								<option value ="" selected="selected">--型号--</option> 			
							</select>
							<a title="手动输入" onclick="dictionaryadd('型号',119001,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>
						<li class="argument_cont_li"><span>生产厂家：</span>
							<select class="select_down" id="productionfactory" name="productionfactory">  
								<option value ="" selected="selected">--生产厂家--</option> 			
							</select>
							<a title="手动输入" onclick="dictionaryadd('生产厂家',119002,this)"><img src="../images/transformer_img_add.png" alt="" /></a>
						</li>							
						<li class="argument_cont_li"><span>导线长度：</span><input class="text" type="text" name="wirelength" value="<%=device.getWirelength()%>"/></li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li" style="position:relative;"><span>出厂日期：</span><input class="text" type="text"  value="<%=PwtzUtils.date2String(device.getFactorydate(), "yyyy-MM-dd")%>" placeholder="请选择日期" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" name="factorydate"/><img width="16" height="16" src="../images/select_date.jpg" style="position:absolute; top:12px;left:230px;" /></li>
						<li class="argument_cont_li"><span>出厂编号：</span><input class="text" type="text" name="serialnumber" value="<%=device.getSerialnumber()%>"/></li>
						<li class="argument_cont_li"><span>导线类型：</span>
							<select class="select_down" name="wirespecification" id="wirespecification">  
								<option value ="绝缘导线">绝缘导线</option>  
								<option value ="裸导线">裸导线</option>	
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>导线排列方式：</span>
							<select class="select_down" name="wirearrange" id="wirearrange">  
								<option value ="水平">水平</option>  
								<option value ="三角">三角</option>
								<option value ="垂直">垂直</option>
							</select>
							<!-- <em style="color:red;"> *</em> -->
						</li>
						<li class="argument_cont_li"><span>导线截面：</span><input class="text" type="text" name="wiresection" value="<%=device.getWiresection()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<li class="argument_cont_li"><span>导线根数：</span><input class="text" type="text" name="wirecount" value="<%=device.getWirecount()%>"/></li>
						<div class="clear"></div>
					</ul>
					<ul class="argument_cont_ul">
						<li class="argument_cont_li"><span>额定载流量：</span><input class="text" type="text" name="ratedcapacity" value="<%=device.getRatedcapacity()%>"/><!-- <em style="color:red;"> *</em> --></li>
						<div class="clear"></div>
					</ul>	
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 物理参数_end -->
			
			<!-- 资产参数_begin -->
			<div class="argument_box">
				<!-- 参数标题-begin -->
				<div class="argument_title">
					<p class="title">资产参数</p>
					<a  class="show"></a>
					<div class="clear"></div>
				</div>				
				<!-- 参数标题-end -->
				<!-- 参数内容_begin -->
				<div class="argument_cont_box">
					<ul class="argument_cont_ul">
						<li class="argument_cont_li">
							<span>资产性质：</span>
							<select class="select_down" id="assetsnature" name="assetsnature">  
								<option value ="用户" selected="selected">用户</option>  
								<option value ="公司">公司</option>
								<option value ="子公司">子公司</option>
								<option value ="省(直辖市、自治区)">省(直辖市、自治区)</option>				
							</select>
						</li>
						<li class="argument_cont_li"><span>资产单位：</span><input class="text" type="text" name="assetunit" value="<%=PwtzUtils.validateNull(device.getAssetunit()) %>"/></li>
						<li class="argument_cont_li"><span>资产编号：</span><input class="text" type="text" name="assetnumber" value="<%=PwtzUtils.validateNull(device.getAssetnumber()) %>"/></li>	
						<div class="clear"></div>
					</ul>					
				</div>
				<!-- 参数内容_end -->
			</div>
			<!-- 资产参数_end -->
		</div>	
		<!-- 柱上变压器_end -->		
	</div>
	</form>
	<%}else{ %>
	<h4>设备id错误</h4>
	<%} %>
	<!-- 右侧内容_end -->
	<div class="clear"></div><!-- 清除左右浮动 -->
	</div>
	<!-- main_end -->
	<%@ include file="/user/foot.jsp"%>
</body>
</html>